<template>
  <div>
    <Disease :disease="disease" />
  </div>
</template>

<script>
import Disease from "@/views/disease/Disease";
import {Loading} from "element-ui";

export default {
  name: "DiseaseInfo",
  components: {
    Disease,
  },
  mounted() {
    let loading = Loading.service({fullscreen: true});
    //获取name
    this.name = this.$route.query.name;
    console.log(this.$route.query.name)
    this.getDiseaseList(this.$route.query.name)
    loading.close()
  },
  data() {
    return {
      name:'',
      disease: {
        intro: "简介",
        insurance: "保险信息",
        treat: "常见治疗方式",
        cause: "发病原因",
        nursing: "护理建议",
        getWay: "传播途径",
        treatProb: "治疗概率",
        prevent: "预防措施",
        getProb: "易感人群",
        treatDetail: "治疗详情",
        name: "疾病名称",
        treatPeriod: "治疗周期",
        treatCost: "治疗费用",
        easyGet: "易感方式",
      },
    };
  },
  methods:{
    getDiseaseList(name){
      this.$store.dispatch('getDiseaseList',{name}).then((res) => {
        this.disease = res.disease
      })
    }
  }
};
</script>
